import java.util.*;

/**
 * Created by zhangjinrui on 17/6/27.
 */

public class Solution223 {

    public static void main(String args[]) {
        Solution223 s = new Solution223();
        System.out.println(s.computeArea(-2, -2, 2, 2, 3, 3, 4, 4));
    }

    class Point {
        int v;
        int x;
        int y;

        public Point(int x, int y, int v) {
            this.x = x;
            this.y = y;
            this.v = v;
        }
    }

    public int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
        Point a1 = new Point(A, B, 1);
        Point a2 = new Point(C, D, 1);
        Point b1 = new Point(E, F, 2);
        Point b2 = new Point(G, H, 2);

        List<Point> l = new ArrayList<Point>();
        l.add(a1);
        l.add(a2);
        l.add(b1);
        l.add(b2);

        int overlap = 0;
        if (hasOverlap(l)) {
            Collections.sort(l, new Comparator<Point>() {
                @Override
                public int compare(Point o1, Point o2) {
                    return o1.x - o2.x;
                }
            });
            int a = l.get(2).x - l.get(1).x;
            Collections.sort(l, new Comparator<Point>() {
                @Override
                public int compare(Point o1, Point o2) {
                    return o1.y - o2.y;
                }
            });
            int b = l.get(2).y - l.get(1).y;
            overlap = a * b;
        }
        return (C - A) * (D - B) + (G - E) * (H - F) - overlap;
    }

    public boolean hasOverlap(List<Point> l) {
        Collections.sort(l, new Comparator<Point>() {
            @Override
            public int compare(Point o1, Point o2) {
                return o1.x - o2.x;
            }
        });
        if (l.get(0).v == l.get(1).v) {
            return false;
        }

        Collections.sort(l, new Comparator<Point>() {
            @Override
            public int compare(Point o1, Point o2) {
                return o1.y - o2.y;
            }
        });
        if (l.get(0).v == l.get(1).v) {
            return false;
        }
        return true;
    }

}
